package com.boss.fileapp.enums;

public enum BankNameEnum {

    ICBC("工商银行","ICBC","1"),
    BCM("交通银行","BCM","2");

    private final String bankName;
    private final String bankNameAlias;
    private final String bankCode;

    private BankNameEnum(String bankName, String bankNameAlias, String bankCode){
        this.bankName = bankName;
        this.bankNameAlias = bankNameAlias;
        this.bankCode = bankCode;
    }

    public String getBankName() {
        return bankName;
    }

    public String getBankNameAlias() {
        return bankNameAlias;
    }

    public String getBankCode() {
        return bankCode;
    }

    public static String getBankNameByCode(String bankCode){
        BankNameEnum[] bankNameEnums = BankNameEnum.values();
        for(BankNameEnum bankNameEnum : bankNameEnums){
            if(bankNameEnum.getBankCode().equals(bankCode)){
                return bankNameEnum.getBankName();
            }
        }
        return null;
    }

}
